import router from "@/router/index";

export default {
  toMain: () => {
    router
      .push({
        name: "index",
      })
      .then();
  },
  toRank: () => {
    router
      .push({
        name: "rank",
      })
      .then();
  },
  toChannel: (channelId: number) => {
    router
      .push({
        name: "channel",
        params: {
          id: channelId,
        },
      })
      .then();
  },
  toHome: (userId: string) => {
    router
      .push({
        name: "home",
        params: {
          id: userId,
        },
      })
      .then();
  },
  toVideo: (videoId: string) => {
    router
      .push({
        name: "video",
        params: {
          id: videoId,
        },
      })
      .then();
  },
  toUpload: () => {
    router
      .push({
        name: "upload",
      })
      .then();
  },
  toManage: () => {
    router
      .push({
        name: "manage",
      })
      .then();
  },
  toData: () => {
    router
      .push({
        name: "data",
      })
      .then();
  },
  toSearch: (content: string) => {
    router
      .push({
        name: "search",
        params: {
          content: content,
        },
      })
      .then();
  },
};
